﻿Public Class ClsTheLoai
    Public Shared Function Them(ByVal MaTL As String, ByVal TenTL As String) As Boolean
        Return db.Query("Insert into TheLoai values ('" & MaTL & "',N'" & TenTL & "')")

    End Function
    Public Shared Function DSTheLoai() As DataTable
        Return db.QueryTable("Select * from TheLoai")
    End Function
    Public Shared Function Xoa(ByVal MaTL As String) As Boolean
        Return db.Query("delete from TheLoai where MaTL ='" & MaTL & "'")
    End Function
    Public Shared Function Sua(ByVal MaTL As String, ByVal TenTL As String) As Boolean
        Return db.Query("update TheLoai set TenTL =N'" + TenTL + "' where MaTL ='" + MaTL + "'")


    End Function
    Public Shared Function TimKiem(ByVal tukhoa As String) As DataTable
        Return db.QueryTable("select * from TheLoai where MaTL like '%" & tukhoa & "%' or TenTL like N'%" & tukhoa & "%'")
    End Function
End Class
